<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1 v-bind:title="title">标题</h1>
        <p>{{message}}</p>
        <p v-if="seen">你看到我了</p>
        <p v-for="stu in students">
            姓名：{{stu.name}}，年龄：{{stu.age}}
        </p>
        <p>
            obj:{{obj}}
        </p>
        <input type="text" v-model="message">
        <input type="button" value="OK" v-on:click="handleClick">
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.10/dist/vue.js"></script>
    <script>
        let app = new Vue({
            el:"#app",
            beforeCreate(){
                console.log("beforeCreate")
            },
            created(){
                console.log("created")
            },
            beforeMount(){
                console.log("beforeMount")
            },
            mounted(){
                console.log("mounted")
            },
            beforeUpdate(){
                console.log("beforeUpdate")
            },
            updated(){
                console.log("updated")
            },
            beforeDestory(){
                console.log("beforeDestory")
            },
            destoryed(){
                console.log("destoryed")
            },
            data:{
                title:"这是标题",
                message:"hello vue",
                seen:true,
                students:[
                    {name:"张飞",age:20},
                    {name:"关羽",age:21},
                    {name:"刘备",age:22},
                ],
                obj:{
                    a:0
                }
            },
            methods:{
                handleClick(){
                    console.log("click");
                }
            }
        });

    </script>
</body>
</html>